home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / squota-0.01 / squota-0~ / Squota / Squotaday < prev   
Text File  |  1996-05-07  |  636b  |  24 lines

  1. #!/bin/bash
  2. # This one add the total at the end of each day
  3. # INIT VARIBLES
  4. . /var/adm/Squota/quotavars
  5. # True Start
  6. while test $EMPTY != $PULENGTH
  7. do
  8. # start on first line
  9.   EMPTY=`expr $EMPTY + 1`
  10. #
  11. # get the users name
  12. #
  13.   USERSHOME=`head -$EMPTY $HQ/quota.users | tail -1`
  14.     if test -d $WHATDIR/$USERSHOME
  15.       then
  16. # use expr to do math
  17. # echo out daily totals, format with sed to make " " to " + "
  18. # then divide today with # of days...
  19.         FSTOTAL=`echo \`cat $USERSHOME.$MON\`  | sed 's/ / + /g'`
  20.         echo $DAY$USERSHOME `expr \( $FSTOTAL \) / $DAY` / `expr $FSLIMIT \* 1024`K >>/var/adm/quota.daily.$MON
  21.     fi
  22. done
  23.  
  24.